Skip to content

Worksheet: improve hover support #5900

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 14, 2019

Conversation

smarter
Copy link
Member

@smarter smarter commented Feb 11, 2019

Hovering on any part of a statement now displays the worksheet output for this statement in a popup if available, this improves on the existing behavior where this only happened when hovering over the last line of the statement. This required changing the worksheet/publishOutput command to return a range rather than a line number.

Also upgrade dependencies and minor changes in the language server.

This allows us to resolve one TODO.
Instead of having a positionMapper argument for `range`, `location`, etc,
choose the right `positionMapper` in range directly
currentCtx is a def which is updated after each run, so when making it
available implicitly, we shouldn't use a val.
This command is sent from the server to the client when a statement in
the current worksheet has finished running, but statements can be
multi-line so returning just the line number loses some information.

We use this extra information in vscode-dotty so that the hover pop-up
containing the output of the statement is displayed when hovering over
any part of the statement, and not just the last line. To avoid breaking
this hover pop-up when using an old version of Dotty, some compatibiltiy
code is necessary.
Copy link
Contributor

@nicolasstucki nicolasstucki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

@smarter smarter merged commit fa4daf1 into scala:master Feb 14, 2019
@allanrenucci allanrenucci deleted the worksheet-improvements branch February 14, 2019 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants